/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

        
package javaapplication2.control;


import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;

/**
 *
 * @author parallels
 */
public class Validate {
    
    public boolean val (String email) {
        
        boolean isValid = true;
        InternetAddress internetAddress;
        
        try {
            internetAddress = new InternetAddress(email);
            internetAddress.validate();
            isValid = true;
        } catch (AddressException ex) {
            isValid = false;
            Logger.getLogger(Validate.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return isValid;
    }
    
}
